// 笔试强训day29:消减整数

#include <iostream>
using namespace std;

int main() {
    int T = 0, H = 0; cin >> T;
    while(T--)
    {
        cin >> H;
        int ans = 0;
        while(H != 0)
        {
            H--;
            if(H % 2 == 0)
            {
                H /= 2;
            }
            ans++;
        }
        cout << ans << endl;
    }
}